//
//  MiddleViewController.m
//  SG
//
//  Created by FISH on 2018/4/18.
//  Copyright © 2018年 yimindai. All rights reserved.
//

#import "MiddleViewController.h"

@interface MiddleViewController ()

@end

@implementation MiddleViewController
-(void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    for(UIView *sub in self.view.subviews)
    {
        [sub removeFromSuperview];
    }
    if ([[Singleton ShareDatabase].viewController isKindOfClass:[HomeViewController class]]) {
        HomeViewController *HomeVC = [[HomeViewController alloc]init];
        HomeVC.view.frame = CGRectMake(0, kTabBarHeight, kScreenWidth, kScreenHeight-kTabBarHeight);
        [self.view addSubview:HomeVC.view];

    }
    else if ([[Singleton ShareDatabase].viewController isKindOfClass:[ManageViewController class]]) {
        ManageViewController *HomeVC = [[ManageViewController alloc]init];
        [self.view addSubview:HomeVC.view];
    }
    else if ([[Singleton ShareDatabase].viewController isKindOfClass:[SkillsViewController class]]) {
        SkillsViewController *HomeVC = [[SkillsViewController alloc]init];
        [self.view addSubview:HomeVC.view];
    }
    else if ([[Singleton ShareDatabase].viewController isKindOfClass:[PersonalViewController class]]) {
        PersonalViewController *HomeVC = [[PersonalViewController alloc]init];
        [self.view addSubview:HomeVC.view];
    }
    else
    {
        HomeViewController *HomeVC = [[HomeViewController alloc]init];
        [self.view addSubview:HomeVC.view];
    }
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationController.navigationBarHidden = YES;//导航消失

    self.view.backgroundColor = [UIColor yellowColor];
    
   

    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
